Agent SaaS Boilerplate

The full template the production systems were built from

Track 04 of four. FastAPI backend, Kahn's-algorithm DAG scheduler, SSE live telemetry to the dashboard, and dual-provider billing (Stripe + Razorpay). Clone, deploy, ship your own agent SaaS.

Open source github.com ↗
Track
04 of 4 · Full SaaS template
Stack
FastAPI Python 3.12 async PostgreSQL Redis SSE Stripe Razorpay Docker
Core pieces
Kahn's algorithm DAG scheduler SSE telemetry stream Dual billing provider Per-user quota
Repository

What this track is

A complete SaaS skeleton optimised for the specific shape of an agent-based product. If you wanted to ship something in the same architectural neighbourhood as Agentic SDLC or Founder's OS, you could fork this repo, swap in your domain logic, and have the infrastructure layer already solved. It's deliberately closer to a template than a library : the readable code is the point.

Integrated SaaS & Agent Telemetry Architecture

Template Internals : DAG Scheduler + Live SSE Telemetry

What's in the template

Kahn's-algorithm topological scheduler

Most agent pipelines are DAGs : one or two roots, leaves that produce the final artefact, and a partial order in between. The scheduler accepts a DAG definition (nodes + dependencies), validates that there are no cycles, and runs nodes in topological order with maximum parallelism for independent branches. If you've ever read about Kahn's algorithm in a textbook, this is what it looks like in production.

Server-Sent Events for live telemetry

When a long-running agent pipeline kicks off, the client opens an SSE stream and watches every agent's progress live : not a polling spinner, actual streamed events. Implementation handles reconnection with last-event-id, heartbeats to keep proxies happy, and back-pressure on slow clients. This is the pattern used in the live Agentic SDLC dashboard.

Dual-provider billing checkouts

Stripe for international, Razorpay for India. The same product catalog backs both providers. Webhook handlers are HMAC-verified on both sides (lifted from the AgentKernel webhook engine). The non-obvious work is the unified subscription model : abstracting over the differences in how the two providers represent the same business state.

Per-user quota and budget enforcement

Quota counters are decremented atomically on each agent run, with budget alerts at configurable thresholds. This is what lets the production betas run with a hard five-user cap : the infrastructure for “you've used your daily allocation, try again tomorrow” is here, not bolted on later.

The relationship to the other tracks

  • Agentic Patterns is the theory.
  • Agentic Systems is the composition : how agents collaborate.
  • AgentKernel is the infrastructure layer : router, cache, queue.
  • Agent SaaS Boilerplate is the integrated whole : what you get when you put all three together and add the SaaS plumbing (auth, billing, telemetry, dashboard).

Honest framing

A boilerplate is only as good as the project it's been battle-tested by. This one has been used to ship two real systems : Agentic SDLC and Founder's OS : both of which are in private beta today. That's the evidence I'd weight if I were reviewing it. It is not a hyper-generalised framework; it makes opinionated choices that fit the kind of product I build.

How to evaluate the code

Three files to read first: the scheduler (where Kahn's algorithm meets async Python), the SSE stream handler (where the dashboard's live updates actually come from), and the billing-webhook router (where the dual-provider abstraction lives). If those three feel sound, the rest of the codebase follows the same conventions.